import { defineStore } from 'pinia'

export const useStore = defineStore('store', {
  state: () => ({
    token: localStorage.getItem('token') || '',
  }),

  actions: {
    setToken(token = '') {
      this.token = token
      localStorage.setItem('token', token)
    },
  },
})
